package com.losdun.product.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.losdun.product.domain.ProdPrice;
import com.losdun.product.mapper.ProdPriceMapper;
import com.losdun.product.service.ProdPriceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 产品报价表service实现类
 *
 * @author swordye
 * @date 2025-06-07
 */
@Slf4j
@Service
public class ProdPriceServiceImpl extends ServiceImpl<ProdPriceMapper,ProdPrice> implements ProdPriceService {

    @Autowired
    private ProdPriceMapper prodPriceMapper;

    @Override
    public Long saveOrUpdateProdPrice(ProdPrice prodPrice) {
        baseMapper.insert(prodPrice);
        return prodPrice.getId();
       /* LambdaQueryWrapper<ProdPrice> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ProdPrice::getCustomerPhone,prodPrice.getCustomerPhone());
        ProdPrice old = baseMapper.selectOne(queryWrapper);
        if(old==null){
            baseMapper.insert(prodPrice);
            return prodPrice.getId();
        }else{
            old.setContent(prodPrice.getContent());
            old.setCustomerName(prodPrice.getCustomerName());
            old.setUpdateTime(new Date());
            baseMapper.updateById(old);
            return old.getId();
        }*/
    }
}
